package dt

object DT_15 extends App {

    val work = new Work with TBeforeAfter

     work.doAction
}


trait Action {
  def doAction
}

trait TBeforeAfter extends Action {
  abstract override def doAction: Unit = {
    println("init")
    super.doAction
    println("destroy")
  }
}

class Work extends Action {
  override def doAction: Unit = println("do working")
}